package com.jingdianjichi.subject.common.enums;

import lombok.Getter;

/**
 * Description: 类别类型枚举
 * Copyright: Copyright (c) 2024
 * Create Time: 2024-07-09 15:45
 *
 * @author wanglianyun
 */
@Getter
public enum CategoryTypeEnum {

    PRIMARY(1, "岗位大类"),

    SECOND(0, "二级分类");

    private int code;

    private String desc;

    CategoryTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CategoryTypeEnum getByCode(int codeVal) {
        for (CategoryTypeEnum resultCodeEnum : CategoryTypeEnum.values()) {
            if (resultCodeEnum.code == codeVal) {
                return resultCodeEnum;
            }
        }

        return null;
    }
}
